﻿using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;


namespace Zero.Entity.Models.Mapping
{
    public class CF_PrivilegeMap : EntityTypeConfiguration<CF_Privilege>
    {
        public CF_PrivilegeMap()
        {
            // Primary Key
            this.HasKey(t => t.PrivilegeID);

            // Properties
            this.Property(t => t.PrivilegeMaster)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.PrivilegeMasterKey)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.PrivilegeAccess)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.PrivilegeAccessKey)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.PrivilegeOperation)
                .IsRequired()
                .HasMaxLength(10);

            this.Property(t => t.CreateUserID)
                .HasMaxLength(50);

            this.Property(t => t.ModifyUserID)
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("CF_Privilege");
            this.Property(t => t.PrivilegeID).HasColumnName("PrivilegeID");
            this.Property(t => t.PrivilegeMaster).HasColumnName("PrivilegeMaster");
            this.Property(t => t.PrivilegeMasterKey).HasColumnName("PrivilegeMasterKey");
            this.Property(t => t.PrivilegeAccess).HasColumnName("PrivilegeAccess");
            this.Property(t => t.PrivilegeAccessKey).HasColumnName("PrivilegeAccessKey");
            this.Property(t => t.PrivilegeOperation).HasColumnName("PrivilegeOperation");
            this.Property(t => t.CreateUserID).HasColumnName("CreateUserID");
            this.Property(t => t.CreateDate).HasColumnName("CreateDate");
            this.Property(t => t.ModifyUserID).HasColumnName("ModifyUserID");
            this.Property(t => t.ModifyDate).HasColumnName("ModifyDate");
            this.Property(t => t.IsEnable).HasColumnName("IsEnable");
            this.Property(t => t.OrderIndex).HasColumnName("OrderIndex");

        }
    }
}
